[XEN] Add arch hook for max_mem domctl.
authorHollis Blanchard <hollisb@us.ibm.com>
Thu, 1 Mar 2007 19:18:51 +0000 (13:18 -0600)
committerHollis Blanchard <hollisb@us.ibm.com>
Thu, 1 Mar 2007 19:18:51 +0000 (13:18 -0600)
This patch introduces an arch hook in the MAX_MEM hcall. In particular, PowerPC
will use this hook to create/update a p2m mapping array. This patch introduces
the hook only and should compile away on all arches.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : %BD%0B%97%A5i%FE%9F%5C%99%C2%01S%80%B6%C0%F0%82_l%A3

xen/common/domctl.c
xen/include/asm-ia64/shadow.h
xen/include/asm-powerpc/shadow.h
xen/include/asm-x86/shadow.h

index fd85b8cbd8382c4e0a5926184a911fd6dfdd4b32..3a45586d65c1d9a08fdf6204b68df16b2297f5b4 100644 (file)
@@ -20,6 +20,7 @@
 #include <xen/rcupdate.h>
 #include <xen/guest_access.h>
 #include <xen/bitmap.h>
+#include <xen/shadow.h>
 #include <asm/current.h>
 #include <public/domctl.h>
 #include <acm/acm_hooks.h>
@@ -608,6 +609,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         spin_lock(&d->page_alloc_lock);
         if ( new_max >= d->tot_pages )
         {
+            ret = guest_physmap_max_mem_pages(d, new_max);
+            if ( ret != 0 )
+                break;
             d->max_pages = new_max;
             ret = 0;
         }
index b877f76ea24c8c5aa33631bb9f9d9dd80f918493..12d16c0e4be6cd6e682435dd034e6a0d7f4e4d4e 100644 (file)
@@ -61,6 +61,8 @@ shadow_mark_page_dirty(struct domain *d, unsigned long gpfn)
         return 0;
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif // _XEN_SHADOW_H
 
 /*
index e58191a7e92185d897081b731c6ead3d8e12894b..f9703270ab1f89e49609b0630270346c073963fb 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005, 2006
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ *          Ryan Harper <ryanh@us.ibm.com>
  */
 
 #ifndef _ASM_SHADOW_H_
@@ -58,4 +59,8 @@ static inline unsigned int shadow_get_allocation(struct domain *d)
 {
     return (1ULL << (d->arch.htab.order + PAGE_SHIFT)) >> 20;
 }
+
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif
+
index cfd8e841c8196d1af1547ce8447e37d985323889..e08b971e7a20cf6e5a2cf0af441f0fb7540f8f4c 100644 (file)
@@ -121,6 +121,8 @@ static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
     sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif /* _XEN_SHADOW_H */
 
 /*